package com.example.client.config;

import com.example.client.service.RmiService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiProxyFactoryBean;

/**
 * @Author: YAOZUN
 * @Date: Created in 18:41 2018/12/16 0016
 * @Description:
 */
@Configuration
public class RmiClientConfig {
    private static final String url = "rmi://127.0.0.1:1099/rmiService";
    private static final String remoteUrl = "rmi://47.107.224.239/rmiService";
    @Bean(name = "rmiServiceTest")
    public RmiProxyFactoryBean initRmiProxyFactoryBean() {
        RmiProxyFactoryBean factoryBean = new RmiProxyFactoryBean();
        factoryBean.setServiceUrl(remoteUrl);
        factoryBean.setServiceInterface(RmiService.class);
        return factoryBean;
    }

}
